package com.jgsu.sell.utils;

import com.jgsu.sell.vo.ResultVO;
import lombok.Data;

/**
 * 描述:
 * RESULTVO工具
 *
 * @author lqd12
 * @create 2018-08-16 23:27
 */
@Data
public class ResultVoUtil {

    public static ResultVO success(Object object){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(object);
        return resultVO;
    }

    public static ResultVO success(){
        return success(null);
    }

    public static ResultVO error(Integer code,String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setMsg(msg);
        resultVO.setCode(code);
        return resultVO;

    }
}